package com.gzh;

import com.gzh.pojo.Order;
import com.gzh.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    public List<Order> find1();

    @Select("select * from user")
    @Results({
            @Result(id = true, property = "id", column = "id"),
            @Result(property = "username",column = "username"),
            @Result(property = "password",column = "password"),
            @Result(property = "orderList",column = "id",
            javaType = List.class,
            many = @Many(select = "com.gzh.UserMapper.find3"))
    })
    public List<User> find2();

    @Select("select * from orders where uid=#{uid}")
    public List<Order> find3(int uid);
}
